﻿using ProMvc.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace ProMvc.Controllers
{
    public class ProductController : Controller
    {
        //
        // GET: /Product/
        Product myProduct = new Product()
        {
            Category = "WaterSport",
            Description = "A boat for one person",
            Name = "Nike",
            Price = 100M,
            ProductID = 1
        };

        public ActionResult Index()
        {
            return View(myProduct);
        }

        public ActionResult Price()
        {
            ViewBag.Name = myProduct.Name;
            return View(myProduct);
        }

        public ActionResult ProductArray()
        {
            Product[] prods = { 
                                new Product(){ Name = "Lining",Price=1200M},
                                 new Product(){ Name = "Anta",Price=100M}
                              };
            return View(prods);
        }
    }
}
